using Unity.Entities;
using Unity.Transforms;
using UnityEngine;

public class PlayerSpawner : MonoBehaviour
{
    public GameObject playerPrefab; // 在 Inspector 中设置

    private Entity playerEntityPrefab;

    void Start()
    {
        //// 获取 EntityManager
        //EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;

        //// 将 GameObject 转换为实体
        //playerEntityPrefab = GameObjectConversionUtility.ConvertGameObjectHierarchy(playerPrefab, GameObjectConversionSettings.FromWorld(entityManager.World, null));

    
        //    // 创建实体
        //    Entity playerEntity = entityManager.Instantiate(playerEntityPrefab);

        //    // 设置位置
        //    entityManager.SetComponentData(playerEntity, new Translation { Value = new Unity.Mathematics.float3(0, 0, 0) });
        //    playerPrefab.SetActive(false);
    }
}
